<html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
        <title>1. Introduction</title>
        <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" title="Ref" charset="utf-8"/>
    </head>
    <body class="body">
    <h1><a name="1. Introduction">1. Introduction</a></h1>This plugin enables the creation of Grails applications that will run without (outside of) a servlet/webapp container or a J(2)EE Application Server.
It allows:
<ul class="star">
<li>To start long running Grails (batch) processes;</li>
<li>To embed Grails in any regular Java application, container or server.</li>
</ul><p class="paragraph"/>The created application can use all non-servlet specific parts of a Grails application, like:
<ul class="star">
<li>GORM/Hibernate support;</li>
<li>Dependency Injection through Spring Framework;</li>
<li>Transactional service layer;</li>
<li>Grails Plugins (provided that the plugin does not depend of a servlet container or webapp environment to run - For example, quartz plugin).</li>
</ul><p class="paragraph"/><h2><a name="1.1 Quick Start">1.1 Quick Start</a></h2>Create your Grails application<p class="paragraph"/><div class="code"><pre>grails create&#45;app test&#45;batch&#45;prj
cd test&#45;batch&#45;prj</pre></div><p class="paragraph"/>Install the plugin<p class="paragraph"/><div class="code"><pre>grails install&#45;plugin batch&#45;launcher</pre></div><p class="paragraph"/>If you want, add "hello world" to your grails-app/conf/Main.groovy<p class="paragraph"/><div class="code"><pre>def run = &#123; context &#45;&#62;
     println <span class="java&#45;quote">"Hello world!"</span>
     println <span class="java&#45;quote">"App args are $&#123;context.args&#125;"</span> 
   &#125;</pre></div><p class="paragraph"/>Go ahead and run your application<p class="paragraph"/><div class="code"><pre>grails batch&#45;run&#45;app</pre></div><p class="paragraph"/>Prepare your application to deployment<p class="paragraph"/><div class="code"><pre>grails batch&#45;war</pre></div><p class="paragraph"/>Done!
    </body>
</html>
